import axios from 'axios'

export default {
  async getCommodity (id , barCode , shelfId , orderId) {
    let result = await axios({
      url: '/api/store/'+id+'/commodity',
      method: 'get',
      params: {
        barCode:barCode,
        shelfId:shelfId,
        orderId:orderId
      }
    })
    return result
  },
  async getRandomCommodity (id) {
    let result = await axios({
      url: '/api/store/'+id+'/commodity',
      method: 'get',
    })
    return result
  },
  async buy ( id , data) {
    let result = await axios({
      url: '/api/store/'+id+'/buy',
      method: 'post',
      data: data
    })
    return result
  }

}
